{extend name='base'/}
{block name='content'}

    <ol class="breadcrumb" style="background-color: #f9f9f9;padding:8px 0;margin-bottom:10px;">
        <li>
            <a href=""><i class="fa fa-cogs"></i>
                标签管理</a>
        </li>
        <li class="active">
            <a href="">标签展示</a>
        </li>
    </ol>
    <ul class="nav nav-tabs" role="tablist">
        <li class="active"><a href="">标签管理</a></li>
        <li><a href="{:url('admin/Tag/store')}">添加标签</a></li>
    </ul>
    <form action="" method="post">
        <div class="panel panel-default">
            <div class="panel-body">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th width="80">编号</th>
                        <th>标签名</th>
                        <th width="200">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="list" id="tag"}
                    <tr>
                        <td>{$tag['tid']}</td>
                        <td>{$tag['tname']}</td>
                        <td>
                            <div class="btn-group">
                                <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span></button>
                                <ul class="dropdown-menu dropdown-menu-right">
                                    <li><a href="{:url('store',['tid'=>$tag['tid']])}">编辑</a></li>
                                    <li class="divider"></li>
                                    <li><a onclick="del({$tag['tid']})">删除</a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
        </div>
    </form>
    <div class="pagination pagination-sm" style="margin-left: 35%;">
            {$list->render()}
    </div>

    <!-- 标签删除确认 -->
    <div class="modal fade" id="delcfmModel" data-toggle="modal">
        <div class="modal-dialog">
            <div class="modal-content message_align">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                    <h4 class="modal-title">提示信息</h4>
                </div>
                <div class="modal-body">
                    <p>您确认要删除吗？</p>
                </div>
                <div class="modal-footer">
                    <a class="btn btn-default" data-dismiss="modal">取消</a>
                    <form action="delTag" method="post" style="display: inline-block">
                        <input id="del_tid" type="hidden" name="tid" value="">
                        <button class="btn btn-primary" type="submit">确定</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- 标签删除确认end -->
    <script>
        function del(tid) {
            // alert(tid)
            $('#delcfmModel').modal('show');
            $('#del_tid').val(tid);
        }
    </script>
{/block}